<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%//Grab the username and password form the login page
String uname=(String)session.getAttribute("userName");
String pname=request.getParameter("projectName");
String pclient=null;
String pstart_date=null;
String pest_date=null;
String ptype=null;
String priority=null;
String ppp=null;
%>
<%
String query="select client,estimated_date,start_date,type,priority from project where name='"+pname+"'";
Connection db_conn = null;
Statement statement = null;
PreparedStatement pstmt;
ResultSet rs;
try{
Class.forName("com.mysql.jdbc.Driver");
String url= "jdbc:mysql://localhost:3306/db";
db_conn = DriverManager.getConnection( url,"root", "root" );
statement = db_conn.createStatement();
rs=statement.executeQuery(query);
while (rs.next()) { // parse the results
pclient=rs.getString("client");
pstart_date=rs.getString("start_date");
pest_date=rs.getString("estimated_date");
ptype=rs.getString("type");
priority=rs.getString("priority");
}
db_conn.close();
} catch(SQLException e){
e.printStackTrace();
out.println("sql not found");
out.println(e);
} catch(ClassNotFoundException e){
e.printStackTrace();
out.println(e);
}
%>

<table width="400" align="center">
    <tr bgcolor="#EEEEEE" height="20px">
        <th width="99" scope="col">Project</th>
        <th width="279" scope="col">Description</th>
    </tr>
    <tr bgcolor="#FFFFFF">
        <td>Name</td>
        <td><%= pname%></td>
    </tr>
    <tr bgcolor="#FCFCFC">
        <td>Client</td>
        <td><%= pclient%></td>
    </tr>
    <tr bgcolor="#FFFFFF">
        <td>Status</td>
        <td><%= pname%></td>
    </tr>
    <tr bgcolor="#FCFCFC">
        <td>Start Date</td>
        <td><%= pstart_date%></td>
    </tr>
    <tr bgcolor="#FFFFFF">
        <td>End Date</td>
        <td><%= pest_date%></td>
    </tr>
    <tr bgcolor="#FCFCFC">
        <td>Task Allocated</td>
        <td><%= pname%></td>
    </tr>
    <tr bgcolor="#FFFFFF">
        <td>Others Involved</td>
        <td><%= pname%></td>
    </tr>
    <tr>
        <td bgcolor="#FCFCFC">Priority</td>
        <td><%= priority%></td>
    </tr>
</table>
